{"ast":null,"code":"import { usePreviousProps } from '@mui/utils';\nexport default function useBadge(parameters) {\n  var badgeContentProp = parameters.badgeContent,\n    _parameters$invisible = parameters.invisible,\n    invisibleProp = _parameters$invisible === void 0 ? false : _parameters$invisible,\n    _parameters$max = parameters.max,\n    maxProp = _parameters$max === void 0 ? 99 : _parameters$max,\n    _parameters$showZero = parameters.showZero,\n    showZero = _parameters$showZero === void 0 ? false : _parameters$showZero;\n  var prevProps = usePreviousProps({\n    badgeContent: badgeContentProp,\n    max: maxProp\n  });\n  var invisible = invisibleProp;\n  if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n    invisible = true;\n  }\n  var _ref = invisible ? prevProps : parameters,\n    badgeContent = _ref.badgeContent,\n    _ref$max = _ref.max,\n    max = _ref$max === void 0 ? maxProp : _ref$max;\n  var displayValue = badgeContent && Number(badgeContent) > max ? \"\".concat(max, \"+\") : badgeContent;\n  return {\n    badgeContent: badgeContent,\n    invisible: invisible,\n    max: max,\n    displayValue: displayValue\n  };\n}","map":{"version":3,"names":["usePreviousProps","useBadge","parameters","badgeContentProp","badgeContent","invisible","invisibleProp","max","maxProp","showZero","prevProps","displayValue","Number"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/base/BadgeUnstyled/useBadge.js"],"sourcesContent":["import { usePreviousProps } from '@mui/utils';\nexport default function useBadge(parameters) {\n  const {\n    badgeContent: badgeContentProp,\n    invisible: invisibleProp = false,\n    max: maxProp = 99,\n    showZero = false\n  } = parameters;\n  const prevProps = usePreviousProps({\n    badgeContent: badgeContentProp,\n    max: maxProp\n  });\n  let invisible = invisibleProp;\n  if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n    invisible = true;\n  }\n  const {\n    badgeContent,\n    max = maxProp\n  } = invisible ? prevProps : parameters;\n  const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;\n  return {\n    badgeContent,\n    invisible,\n    max,\n    displayValue\n  };\n}"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,YAAY;AAC7C,eAAe,SAASC,QAAQ,CAACC,UAAU,EAAE;EAC3C,IACgBC,gBAAgB,GAI5BD,UAAU,CAJZE,YAAY;IAAA,wBAIVF,UAAU,CAHZG,SAAS;IAAEC,aAAa,sCAAG,KAAK;IAAA,kBAG9BJ,UAAU,CAFZK,GAAG;IAAEC,OAAO,gCAAG,EAAE;IAAA,uBAEfN,UAAU,CADZO,QAAQ;IAARA,QAAQ,qCAAG,KAAK;EAElB,IAAMC,SAAS,GAAGV,gBAAgB,CAAC;IACjCI,YAAY,EAAED,gBAAgB;IAC9BI,GAAG,EAAEC;EACP,CAAC,CAAC;EACF,IAAIH,SAAS,GAAGC,aAAa;EAC7B,IAAIA,aAAa,KAAK,KAAK,IAAIH,gBAAgB,KAAK,CAAC,IAAI,CAACM,QAAQ,EAAE;IAClEJ,SAAS,GAAG,IAAI;EAClB;EACA,WAGIA,SAAS,GAAGK,SAAS,GAAGR,UAAU;IAFpCE,YAAY,QAAZA,YAAY;IAAA,gBACZG,GAAG;IAAHA,GAAG,yBAAGC,OAAO;EAEf,IAAMG,YAAY,GAAGP,YAAY,IAAIQ,MAAM,CAACR,YAAY,CAAC,GAAGG,GAAG,aAAMA,GAAG,SAAMH,YAAY;EAC1F,OAAO;IACLA,YAAY,EAAZA,YAAY;IACZC,SAAS,EAATA,SAAS;IACTE,GAAG,EAAHA,GAAG;IACHI,YAAY,EAAZA;EACF,CAAC;AACH"},"metadata":{},"sourceType":"module"}